﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MediaController.Client.DAL
{
    public static class Logger
    {
        public static event Action<string> NewLogMessage;

        public static void Log(string msg)
        {
            string newMsg = string.Format("[{0}]: {1}", DateTime.Now, msg);
            InvokeNewLogMessage(newMsg);
        }

        private static void InvokeNewLogMessage(string msg)
        {
            Action<string> handler = NewLogMessage;
            if (handler != null) handler(msg);
        }
    }
}
